package com.tgh.help.adapter;

import java.util.ArrayList;
import java.util.List;

import com.tgh.help.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class UploadSingleGridAdapter extends BaseAdapter {

	private Context context;
	/** 列表. */
	private List<String> lstDate;
	/** 名字. */
	private TextView txtName;
	/** 性别. */
	private TextView txtSex;
	/** 年龄. */
	private TextView txtAge;
	private ImageView avatarImg;

	// 每页显示的Item个数
	public static final int SIZE = 18;

	public UploadSingleGridAdapter(Context mContext, List<String> list, int page) {
		this.context = mContext;
		lstDate = new ArrayList<String>();
		int i = page * SIZE;
		int iEnd = i + SIZE;
		while ((i < list.size()) && (i < iEnd)) {
			lstDate.add(list.get(i));
			i++;
		}
	}

	public int getCount() {
		return lstDate.size();
	}

	public Object getItem(int position) {
		return lstDate.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		String fileName = lstDate.get(position);
		convertView = LayoutInflater.from(context).inflate(R.layout.item_upload_single_file, null);

//		txtName = (TextView) convertView.findViewById(R.id.name);
//		txtSex = (TextView) convertView.findViewById(R.id.nickName);
//		txtAge = (TextView) convertView.findViewById(R.id.phone);
//		avatarImg = (ImageView) convertView.findViewById(R.id.imageView);
//		txtName.setText(user.displayName);
//		txtSex.setText(user.nickName);
//		txtAge.setText("鐢佃瘽锛?11111111111111");
//		avatarImg.setImageResource(R.drawable.default_photo);

		return convertView;
	}

}
